package fun.util.daohelper.hibernate.expression;

import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
import org.hibernate.criterion.MatchMode;
import fun.util.daohelper.expression.StartsWith;

/**
 * Author: bin
 * Date: Jan 23, 2006
 * Time: 9:28:35 PM
 */
public class StartsWithTransformer implements ExpressionCriterionTransformer<StartsWith>  {

    public Criterion transform( StartsWith startsWith ) {
        return Restrictions.like( startsWith.getFieldName(), startsWith.getValue(), MatchMode.START );
    }
}
